package com.sk.cardeal.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sk.cardeal.R;
import com.sk.cardeal.entity.ConsultListBean;
import com.sk.cardeal.utils.HttpAddress;

import java.util.List;

/**
 * Created by sk on 2018/3/13.
 */

public class ConsultAdapter extends BaseQuickAdapter<ConsultListBean.ResultListBean,BaseViewHolder> {

    public ConsultAdapter(int layoutResId, @Nullable List<ConsultListBean.ResultListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ConsultListBean.ResultListBean item) {
        Glide.with(mContext).load(HttpAddress.ossPath+item.getPath()).into((ImageView) helper.getView(R.id.item_bg));
        helper.setText(R.id.tv_title,item.getTitle())
                .setText(R.id.tv_time,item.getCreateTime().substring(0,10))
                .setText(R.id.tv_name,item.getPersonName());
    }
}
